# $Id: PKGBUILD 57879 2011-11-04 08:01:07Z lcarlier $
# Maintainer: Jaroslav Lichtblau <dragonlord@aur.archlinux.org>
# Contributor: Allan McRae <allan@archlinux.org>
# Contributor: geekitus

pkgname=blobwars
pkgver=1.19
pkgrel=4
pkgdesc="Platform action game featuring a blob wih lot of weapons"
arch=('i686' 'x86_64')
url="http://sourceforge.net/projects/blobwars"
license=('GPL')
makedepends=('sdl_image' 'sdl_mixer' 'sdl_ttf' 'sdl_net')
install=$pkgname.install
source=(http://downloads.sourceforge.net/project/$pkgname/$pkgname-$pkgver.tar.gz)
md5sums=('87e8aaa114b6e4742ea6ee28e7a7f984')

build() {
  cd "${srcdir}/${pkgname}-${pkgver}"

  # fix building with gcc 4.6
  sed -i -e 's/-Werror/-Werror -Wno-error=unused-result/g' makefile

  RELEASE=1 make 
}

package() {
  depends=('hicolor-icon-theme' 'sdl_image' 'sdl_mixer' 'sdl_ttf' 'sdl_net' 'blobwars-data>=1.19')

  cd "${srcdir}/${pkgname}-${pkgver}"

  make PREFIX="${pkgdir}/usr" BINDIR="${pkgdir}/usr/bin/" install

  # We remove data files (See blobwars-data)
  rm -r "${pkgdir}/usr/share/games"

  chmod a+r "${pkgdir}/usr/share/applications/${pkgname}.desktop"
  chmod a+r -R "${pkgdir}/usr/share/icons/hicolor/"
  install -dm755 "${pkgdir}/usr/share/pixmaps"
  install -m644 icons/blobwars.png "${pkgdir}/usr/share/pixmaps/"
}
